<?php
	$ISTEXT = 0 ; // do not format the output into layout!
	header('Content-type: text/html; charset=utf-8');
	$query = "select * from `radio_dj` where `userid`='$id'";
	$result = mysql_query($query);
	?>
	<html><head></head><body><script language="JavaScript">
	<?php
	include ("blaatschaap.js");	
	?></script><?php
	if (mysql_num_rows($result)) {
		$djprofile = mysql_fetch_array($result);
		$dj_id = $djprofile['id'];
		$query = "select * from `radio_request`";
		$result = mysql_query($query);
		if ($_REQUEST['delete']) {
			$delete = escapestr($_REQUEST['delete']);
			$query  = "delete from `radio_request` where `id`='$delete'";
			$result = mysql_query($query);
			echo GetLangString ($lang, "msg_reqdeleted");
		} else 
		if ($_REQUEST['popup']) {
				echo "<center><table border=\"1\" width=\"66%\">";
				while ($request = mysql_fetch_array($result)) {
					echo "<tr><td width=\"25%\">".GetLangString($lang,"txt_from")			."</td><td width=\"75%\">".$request['from']	."</td></tr>
								<tr><td width=\"25%\">".GetLangString($lang,"txt_to")				."</td><td width=\"75%\">".$request['to']		."</td></tr>
								<tr><td width=\"25%\">".GetLangString($lang,"txt_artist")		."</td><td width=\"75%\">".$request['artist']."</td></tr>
								<tr><td width=\"25%\">".GetLangString($lang,"txt_song")			."</td><td width=\"75%\">".$request['song']	."</td></tr>
								<tr><td width=\"25%\">".GetLangString($lang,"txt_comment")	."</td><td width=\"75%\">".bb2html($request['text'])	."</td></tr>
								<tr><td width=\"25%\"><a href=\"/index.php?do=djrequest&delete=".$request['id']."\">"
								.GetLangString($lang,"txt_delete").  "</a></td><td></td></tr>";
				

					}
				echo ("</table></center");
		} else { ?>
			<meta http-equiv="refresh" content="60">
			<?php
			echo FormatElement(GetLangString($lang,"txt_djreq"),GetLangString($lang,"msg_djreq"));
			if (mysql_num_rows($result)) {
				?>
				<script language="JavaScript">ShowRequestWindow();</script>
				<?php
			}
		}
			
		
	} else {
		echo FormatElement(GetLangString($lang,"txt_error"),GetLangString($lang,"msg_nodjerror"));
	} 
	echo "</body></html>";
?>
